/**
 * 
 */
package com.ntv.persistent.obituary;

import java.sql.ResultSet;
import java.sql.SQLException;

import org.springframework.jdbc.core.RowMapper;

import com.ntv.domain.IObituary;
import com.ntv.domain.Obituary;

/**
 * @author Kavi
 * @Since 04/02/2009
 */
public class ObituaryRowMapper implements RowMapper{

	public Object mapRow(ResultSet rs, int idx) throws SQLException {
		IObituary obituary = new Obituary();
		
		obituary.setId(rs.getLong("id"));
		obituary.setAge(rs.getInt("age"));
		obituary.setName(rs.getString("person_name"));
		obituary.setContactDetails(rs.getString("contact_detail"));
		obituary.setFamilyMembersNames(rs.getString("family_members_name"));
		obituary.setFuneralDetails(rs.getString("funeral_detail"));
		obituary.setParentName(rs.getString("parent_name"));
		obituary.setDateOfDeath(rs.getDate("date_of_death"));
		obituary.setNativePlace(rs.getString("native_place"));
		
		return obituary;
	}
	
}
